1 % Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
3 {\ttfamily \raggedright {
5 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$iostream$>$
}} \\
6 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$cassert$>$
}} \\
7 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$stdio.h$>$
}} \\
8 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$assert.h$>$
}} \\
9 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$wchar.h$>$
}} \\
10 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$wctype.h$>$
}} \\
11 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$locale.h$>$
}} \\
14 \mbox{}\textbf{\textcolor{Blue
}{using
}}\
\textbf{\textcolor{Blue
}{namespace
}}\ std
\textcolor{BrickRed
}{;
} \\
16 \mbox{}\textcolor{ForestGreen
}{int
}\
\textbf{\textcolor{Black
}{main
}}\textcolor{BrickRed
}{()
}\textcolor{Red
}{\
{} \\
17 \mbox{}\ \
\textbf{\textcolor{Black
}{assert
}}\textcolor{BrickRed
}{(
}\textbf{\textcolor{Black
}{setlocale
}}\textcolor{BrickRed
}{(
}LC$
\_$ALL
\textcolor{BrickRed
}{,
}\
\texttt{\textcolor{Red
}{"
{}en$
\_$US.UTF-
8"
{}}}\textcolor{BrickRed
}{)
}\
\textcolor{BrickRed
}{!=
}\ NULL
\textcolor{BrickRed
}{);
} \\
18 \mbox{}\ \
\textcolor{ForestGreen
}{wchar$
\_$t
}\ in$
\_$buf
\textcolor{BrickRed
}{[}\textcolor{Purple
}{512}\textcolor{BrickRed
}{],
}\ out$
\_$buf
\textcolor{BrickRed
}{[}\textcolor{Purple
}{512}\textcolor{BrickRed
}{];
} \\
19 \mbox{}\ \
\textbf{\textcolor{Black
}{swprintf
}}\textcolor{BrickRed
}{(
}out$
\_$buf
\textcolor{BrickRed
}{,
}\
\textcolor{Purple
}{512}\textcolor{BrickRed
}{,
}\ L
\texttt{\textcolor{Red
}{"
{}¿Podrías\ escribir\ un\ número?,\ Por\ ejemplo\ \%d.\ ¡Gracias,\ pingüino\ español!
}}\texttt{\textcolor{CarnationPink
}{\textbackslash{}n
}}\texttt{\textcolor{Red
}{"
{}}}\textcolor{BrickRed
}{,
}\
\textcolor{Purple
}{3}\textcolor{BrickRed
}{);
} \\
20 \mbox{}\ \
\textbf{\textcolor{Black
}{fputws
}}\textcolor{BrickRed
}{(
}out$
\_$buf
\textcolor{BrickRed
}{,
}\ stdout
\textcolor{BrickRed
}{);
} \\
22 \mbox{}\ \
\textbf{\textcolor{Black
}{fgetws
}}\textcolor{BrickRed
}{(
}in$
\_$buf
\textcolor{BrickRed
}{,
}\
\textcolor{Purple
}{512}\textcolor{BrickRed
}{,
}\ stdin
\textcolor{BrickRed
}{);
} \\
23 \mbox{}\ \
\textcolor{ForestGreen
}{int
}\ n
\textcolor{BrickRed
}{;
} \\
24 \mbox{}\ \
\textbf{\textcolor{Black
}{swscanf
}}\textcolor{BrickRed
}{(
}in$
\_$buf
\textcolor{BrickRed
}{,
}\ L
\texttt{\textcolor{Red
}{"
{}\%d"
{}}}\textcolor{BrickRed
}{,
}\
\textcolor{BrickRed
}{\&
}n
\textcolor{BrickRed
}{);
} \\
26 \mbox{}\ \
\textbf{\textcolor{Black
}{swprintf
}}\textcolor{BrickRed
}{(
}out$
\_$buf
\textcolor{BrickRed
}{,
}\
\textcolor{Purple
}{512}\textcolor{BrickRed
}{,
}\ L
\texttt{\textcolor{Red
}{"
{}Escribiste\ \%d,\ yo\ escribo\ ¿ÔÏàÚÑ
\textasciitilde{}}}\texttt{\textcolor{CarnationPink
}{\textbackslash{}n
}}\texttt{\textcolor{Red
}{"
{}}}\textcolor{BrickRed
}{,
}\ n
\textcolor{BrickRed
}{);
} \\
27 \mbox{}\ \
\textbf{\textcolor{Black
}{fputws
}}\textcolor{BrickRed
}{(
}out$
\_$buf
\textcolor{BrickRed
}{,
}\ stdout
\textcolor{BrickRed
}{);
} \\
29 \mbox{}\ \
\textbf{\textcolor{Blue
}{return
}}\
\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
} \\
30 \mbox{}\textcolor{Red
}{\
}} \\
34 } \normalfont\normalsize